package com.netease.nim.uikit.xpopup.popuview

import android.content.Context
import android.view.View
import com.lxj.xpopup.core.BottomPopupView
import com.lxj.xpopup.util.XPopupUtils
import www.wen.com.common.R
import www.wen.com.common.lib.extension.setOnClickListenerAgency
import www.wen.com.common.lib.helper.ResultUiCallBack


/**
 * @author WEN
 * @Description: 底部弹出的分组、频道设置
 * @date 2021/4/25 21:35
 */
class BottomGroupPopupView(
        context: Context,
        private val resultCallBack: ResultUiCallBack<String>? = null,
) : BottomPopupView(context), View.OnClickListener {

    private lateinit var mGroupView:View

    private lateinit var mChannel:View

    override fun getImplLayoutId(): Int = R.layout.popupview_grouping

    override fun getMaxHeight(): Int = (XPopupUtils.getScreenHeight(context) * 0.35f).toInt()

    override fun onCreate() {
        super.onCreate()
        mGroupView = findViewById(R.id.strGrouping)
        mChannel = findViewById(R.id.strFrequency)
        setOnClickListenerAgency(this, mGroupView, mChannel)
    }

    override fun onClick(v: View) {
        dismiss()
        resultCallBack?.invoke(v,"",this)
    }


}